package org.domain.sisteste.entity;

// Generated 12/11/2013 11:37:44 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * TbEtapa generated by hbm2java
 */
@Entity
@Table(name = "tb_etapa")
public class Etapa implements java.io.Serializable {

	private int idEtapa;
	private Funcao tbFuncao;
	private String noEtapa;
	private String dsEtapa;
	private Integer nrOrdemEtapa;
	private Set<Teste> taTestes = new HashSet<Teste>(0);

	public Etapa() {
	}

	public Etapa(int idEtapa, Funcao tbFuncao) {
		this.idEtapa = idEtapa;
		this.tbFuncao = tbFuncao;
	}

	public Etapa(int idEtapa, Funcao tbFuncao, String noEtapa,
			String dsEtapa, Integer nrOrdemEtapa, Set<Teste> taTestes) {
		this.idEtapa = idEtapa;
		this.tbFuncao = tbFuncao;
		this.noEtapa = noEtapa;
		this.dsEtapa = dsEtapa;
		this.nrOrdemEtapa = nrOrdemEtapa;
		this.taTestes = taTestes;
	}

	@Id
	@Column(name = "ID_Etapa", unique = true, nullable = false)
	public int getIdEtapa() {
		return this.idEtapa;
	}

	public void setIdEtapa(int idEtapa) {
		this.idEtapa = idEtapa;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CD_Funcao", nullable = false)
	@NotNull
	public Funcao getTbFuncao() {
		return this.tbFuncao;
	}

	public void setTbFuncao(Funcao tbFuncao) {
		this.tbFuncao = tbFuncao;
	}

	@Column(name = "NO_Etapa", length = 25)
	@Length(max = 25)
	public String getNoEtapa() {
		return this.noEtapa;
	}

	public void setNoEtapa(String noEtapa) {
		this.noEtapa = noEtapa;
	}

	@Column(name = "DS_Etapa")
	public String getDsEtapa() {
		return this.dsEtapa;
	}

	public void setDsEtapa(String dsEtapa) {
		this.dsEtapa = dsEtapa;
	}

	@Column(name = "NR_OrdemEtapa")
	public Integer getNrOrdemEtapa() {
		return this.nrOrdemEtapa;
	}

	public void setNrOrdemEtapa(Integer nrOrdemEtapa) {
		this.nrOrdemEtapa = nrOrdemEtapa;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbEtapa")
	public Set<Teste> getTaTestes() {
		return this.taTestes;
	}

	public void setTaTestes(Set<Teste> taTestes) {
		this.taTestes = taTestes;
	}

}
